﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISimulatingEnvironment.cs" company="pwasieewicz">
//   pwasiewicz
// </copyright>
// <summary>
//   Defines the ISimulatingEnvironment type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace LogicSystem.Interfaces
{
    using System;
    using System.Collections.Generic;

    /// <summary>The i simulating environment.</summary>
    /// <typeparam name="TK">The key type.</typeparam>
    /// <typeparam name="TV">The value type.</typeparam>
    public interface ISimulatingEnvironment<TK, TV> where TK : IComparable<TK>
    {
        /// <summary>
        /// Gets or sets total of working of simulating logic system.
        /// </summary>
        int TotalTime { get; set; }

        /// <summary>
        /// Resets environment.
        /// </summary>
        void Reset();

        /// <summary>
        /// Pushes data into heap.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        void PushIntoHeap(TK key, TV value);

        /// <summary>
        /// Pushes data into heap.
        /// </summary>
        /// <param name="items">Collection of key-value pair.</param>
        void PushIntoHeap(IEnumerable<KeyValuePair<TK, TV>> items);

        /// <summary>
        /// Gets element from the top of heap.
        /// </summary>
        /// <returns>Pair from the of heap.</returns>
        KeyValuePair<TK, TV> Top();

        /// <summary>
        /// Pops element from a heap.
        /// </summary>
        /// <returns>Element that was taken from the top.</returns>
        KeyValuePair<TK, TV> PopFromHeap();


        /// <summary>
        /// Determines whether this instance of heap is empty.
        /// </summary>
        /// <returns>
        ///   <c>true</c> if this instance of heap is empty; otherwise, <c>false</c>.
        /// </returns>
        bool IsEmpty();
    }
}
